<template>
  <BaseContainer :show-title="false">
    <a-result status="404" title="404" sub-title="很抱歉，此页面未找到。">
      <template #extra>
        <a-button type="primary" @click="router.replace('/')">返回首页</a-button>
      </template>
    </a-result>
  </BaseContainer>
</template>

<script lang="ts" setup>
import { useRouter } from 'vue-router'
import { onBeforeMount } from 'vue'
import BaseContainer from '@/components/base-container/index.vue'
import { useMainStore } from '@/store/useMainStore'

const router = useRouter()
const mainStore = useMainStore()

onBeforeMount(() => {
  if (!mainStore.userInfo) {
    router.replace('/403')
  }
})
</script>
